add missing indexes on VerificationToken table#20040
Merged
krrishdholakia merged 1 commit intoBerriAI:litellm_oss_staging_01_31_2026from Jan 31, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
JehandadK
approved these changes
Jan 30, 2026
Contributor
JehandadK
left a comment
There was a problem hiding this comment.
Thanks @CAFxX !
@ishaan-jaff Can we move it to CI Testing? Thanks!
5442dc6 to
3c8150e
Compare
3880eb0
into
BerriAI:litellm_oss_staging_01_31_2026
4 of 8 checks passed
Sameerlite
pushed a commit
that referenced
this pull request
Feb 2, 2026
Sameerlite
added a commit
that referenced
this pull request
Feb 3, 2026
This reverts commit 1e8848c.
Sameerlite
added a commit
that referenced
this pull request
Feb 3, 2026
This reverts commit 1e8848c.
6 tasks
This was referenced Feb 9, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On our infrastructure the queries mentioned in the comments in schema.prisma all cause full table scans because the only index is the primary key. As our verificationtoken table is pretty big, those queries have high latency (>100ms) and frequently cause significant CPU utilization spikes, disrupting all other database traffic.
Before creation of the indexes (not during a spike)
After creation of the indexes
Note how the SELECTs become a 1~2 orders of magnitude faster.
This is my first PR involving changes to the schema, so please let me know if the process is correct.
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🐛 Bug Fix
🚄 Infrastructure
Changes